"""
__author__ = '霍格沃兹测试开发学社'
__desc__ = '更多测试开发技术探讨，请访问：https://ceshiren.com/t/topic/15860'
"""
from dao.base_dao import BaseDao
from orm_domain.job import Job
from server import db_session


class JobDao(BaseDao):
    def save(self, job: Job):
        self.add(job)

    def delete(self, job: Job):
        self.delete(job)

    def get_by_id(self, _id) -> Job:
        return self.query(Job).filter_by(id=_id).first()

    def get_list(self) -> [Job]:
        return self.query(Job).all()

    def update(self):
        self.commit()
